home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: a pointer problem
- Date: 16 Feb 1996 16:03:21 GMT
- Organization: Los Alamos National Laboratory
- Distribution: world
- Message-ID: <TANMOY.96Feb16090321@qcd.lanl.gov>
- References: <4errk0$4c3@srvr1.engin.umich.edu> <31120AB7.1C44@cmt.lpr.mail.carel.fi>
- <4et96h$k84@sparcserver.lrz-muenchen.de>
- <4g1a9l$l5@mailhub.scitec.com.au>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: ramsesy@rd.scitec.com.au's message of 16 Feb 1996 07:04:21 GMT
-
- In article <4g1a9l$l5@mailhub.scitec.com.au> ramsesy@rd.scitec.com.au
- (Ramses Youhana) writes:
- <snip>
- It is dangerous to rely on the compiler to do initialisation of static
- and global variables in embedded systems. This is usually the case when
- you write your own boot code and don't include the appropriate routine(s)
- which read the data out of the appropriate section (sometimes called the
- IDATA or INITDATA section) and copies to the appropriate RAM locations
- to initialise your variables.
-
- To the extent you can trust your compiler to be ANSI C, you can trust
- it to do the initialization: embedded systems or hosted environment is
- immaterial in this context.
-
- I always find it better (and safer) design to perform my own initialisations
- in an initialisation function.
-
- You may also find it safer to write i = i + 1 instead of i++: it makes
- not the slightest difference.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-